FROM node AS build
WORKDIR /source

COPY . .
WORKDIR "/source"
RUN npm install
RUN npm run build

FROM nginx AS final
WORKDIR /app
EXPOSE 3002
COPY --from=build /source/dist/ /usr/share/nginx/html
COPY --from=build /source/nginx.conf /etc/nginx/conf.d/default.conf